-
Notifications
You must be signed in to change notification settings - Fork 1
Implement Image and Table support + Laravel Pint addition #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
* Bump dependencies + installing Laravel Pint * .gitignore added * Opinionated pint.json from nunomaduro/essentials added * Pest test fix * Add image processing and update annotations handling
* Bump dependencies + installing Laravel Pint * .gitignore added * Opinionated pint.json from nunomaduro/essentials added * Pest test fix * Add image processing and update annotations handling
* Bump dependencies + installing Laravel Pint * .gitignore added * Opinionated pint.json from nunomaduro/essentials added * Pest test fix * Add image processing and update annotations handling * bump version * Pest tests implemented
* wip * wip
|
Hey @igorsgm, I'll review it this weekend. Thank you. |
roelmagdaleno
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@igorsgm Thanks for this PR.
Adding the image and table components are good features.
I've reviewed all files and found some code that could be improved, let me know your thoughts about it. You'll find my comments on the files.
Also, if possible, let's use defensive programming with guard clauses. That means to remove the else statements and nested if conditions. We're trying to avoid the callback/condition hell and improve code readability.
Here's a good article that explains it all.
Thank you. Let me know any feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@igorsgm The ImageValidator class looks good. I'd move the class to a Validators folder instead of Validation. The ImageValidator class has the word Validator, so I expect that to live inside a folder with the same name.
This is more for a good developer experience. Let's keep a consistency between class names and folders.
- Bump minimum PHP version requirement from 8.0 to 8.1 for enhanced language features (enum) - Refactor image validation by creating ImageType enum to centralize image block creation logic - Convert ImageValidator from static class to instance-based with proper encapsulation - Improve code readability with early returns and guard clauses in MarkdownImageProcessor and NotionBlocksRenderer - Move ImageValidator from Validation to Validators namespace for better organization - Optimize control flow structures using continue statements to reduce nesting depth - Make RichText defaultObject method public static for better reusability across components - Enhance table processing logic with cleaner conditional handling in Table class - Update constructor injection patterns to use readonly properties for better performance - Rename ImageValidationTest to ImageValidatorTest to match new class structure
|
Hi @roelmagdaleno, Thank you for the excellent feedback on this PR! I've successfully addressed all your suggestions: ✅ Changes Made:1. Renamed
|
Hello @roelmagdaleno. Thank you for this useful package. I hope my PR will be a valuable contribution 🙏
Summary
Changes
The changes maintain backward compatibility while significantly improving the package's robustness and code quality standards.